﻿using System.ComponentModel.DataAnnotations;

namespace Yyyg.WebUI.Models
{
    public class UserRegVM
    {
        [Display(Name = "注册手机号")]
        [DataType(DataType.PhoneNumber, ErrorMessage = "手机号格式不正确")]
        [System.Web.Mvc.Remote("HasMobel", "UserReg", ErrorMessage = "该手机号已被注册!")]
        [Required(ErrorMessage = "必须填写注册手机号!")]
        [StringLength(maximumLength: 11, MinimumLength = 11, ErrorMessage = "手机号长度为11")]
        public string Mobel { get; set; }

        [Display(Name = "密码")]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "必须输入{0}")]
        [RegularExpression(@"^\w{6,16}$", ErrorMessage = "密码不符合规范")]
        public string Pwd { get; set; }

        [Display(Name = "确认密码")]
        [Compare(otherProperty: "Pwd", ErrorMessage = "两次输入的密码不一致")]
        [DataType(DataType.Password)]
        public string Confirm { get; set; }
    }
}